RISC-V: Use SBI SRST extension when available
authorAnup Patel <anup.patel@wdc.com>
Wed, 9 Jun 2021 12:13:22 +0000 (17:43 +0530)
committerSalvatore Bonaccorso <carnil@debian.org>
Tue, 8 Mar 2022 17:47:04 +0000 (17:47 +0000)
commit67f60cc46abaabf2ab3a7ea9597615d82b1cf2d2
tree2d7216d91b76c283f58b6cc2b822bd3cc7b47131
parent9ec53767374cd4e91d5ba7610735dca959c9720f
RISC-V: Use SBI SRST extension when available

Origin: https://git.kernel.org/linus/b579dfe71a6a5c3967ca9ad648673b6ca10ab0d5

The SBI SRST extension provides a standard way to poweroff and
reboot the system irrespective to whether Linux RISC-V S-mode
is running natively (HS-mode) or inside Guest/VM (VS-mode).

The SBI SRST extension is available in the SBI v0.3 specification.
(Refer, https://github.com/riscv/riscv-sbi-doc/releases/tag/v0.3.0-rc1)

This patch extends Linux RISC-V SBI implementation to detect
and use SBI SRST extension.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Gbp-Pq: Topic features/riscv64
Gbp-Pq: Name RISC-V-Use-SBI-SRST-extension-when-available.patch
arch/riscv/include/asm/sbi.h
arch/riscv/kernel/sbi.c